<% extend 'shared/admin-base.html' %>
<% block 'head' : %>
<link rel="stylesheet" href="/dist/admin-ads.css"/>
<% end %>
    <div class="row">
        <div class="col-md-2">
            <div class="title-info"><i class="fa fa-users"></i>首页广告管理</div>
        </div>
    </div>
<br/>
<div class="alert alert-sm alert-info alert-dismissible ">
    <button type="button" class="close" data-dismiss="alert" aria-label="Close"><span
            aria-hidden="true">&times;</span></button>
    每张图片大小不可超过2M，广告数最好是3的整倍数
</div>

<div class="row">
    <div class="col-md-2">
        <h2>图片列表:</h2>
    </div>
    <form action="/adminer-super/ads" method="post" id="#form_sample_1" ng-controller="formCtrl" class="form-horizontal form-bordered">
        <div class="form-group">
            <div class="col-md-9">
                <input type="hidden" value="{{imgsUrl}}" name="imgs">
                <div class="fileupload fileupload-new">
                    <div class="fileupload-new thumbnail" style="width: 320px; height: 140px;" ng-show="imgs.length == 0">
                        <img src="/empty.png" alt="" style="width: 320px; height: 130px;"/>
                    </div>
                    <div class="uploaded-imgs" ng-show="imgs.length != 0">
                        <div class="clearfix">
                            <div class="uploaded-imgs-item text-center pull-left " ng-repeat="img in imgs track by $index">
                                <img ng-src="{{img}}" class="img-responsive">
                                <div class="uploaded-imgs-item-tools  text-center">
                                    <span class="btn green " ng-click="remove($index)">删除</span>
                                </div>
                            </div>
                        </div>
                    </div>
                    <div>
                        <a href="#" class="btn blue" id="upload-picker"><i class="fa fa-cloud-upload"></i>添加文件</a>
                    </div>
                </div>
                <span class="label label-danger">注意!</span>
                <span> 每张图片大小不可超过2M，广告数最好是3的整倍数</span>

            </div>
            <div class="col-md-9">
                <div class="col-md-2 col-md-push-8">
                    <button class="btn blue">提交</button>
                </div>
            </div>
        </div>
    </form>
</div>
<script id="imgs" type="text/plain">
    <%- @data?.imgs %>
</script>
<% block 'scripts': %>
<script src="/dist/admin-ads.js"></script>
<% end %>